package gui;

import javax.swing.*;
import java.awt.*;

public class ImageButton extends JButton {
    public ImageButton(String path){
        super();
        setMargin(new Insets(0,0,0,0));//设置边距
        setContentAreaFilled(false);//不绘制按钮区域
        setBorderPainted(false);//不绘制边框
        setIcon(new ImageIcon(path));//设置默认图片
    }
}
